package org.slf4j.impl;

import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;

import java.util.HashMap;
import java.util.Map;

public class FiubaLoggerFactory implements ILoggerFactory {
  private Map<String, FiubaLoggerAdapter> loggerMap;

  public FiubaLoggerFactory() {
    loggerMap = new HashMap<String, FiubaLoggerAdapter>();
  }

  @Override
  public Logger getLogger(String name) {

    synchronized (loggerMap) {
      if (!loggerMap.containsKey(name)) {
        loggerMap.put(name, new FiubaLoggerAdapter(name));
      }

      return loggerMap.get(name);
    }
  }
}
